<?php
class Third_Mail extends Zend_Mail {
	
	private $config = "";
	private $smarty = "";
	
	public function  __construct( ){
		
		$this->config = Zend_Registry::get('config');
		
		$config = array(
				'auth' => 'login',
                'username' => $this->config->mail_stmp_user,
                'password' => $this->config->mail_stmp_pass );
			
			$tr = new Zend_Mail_Transport_Smtp( $this->config->mail_stmp_host, $config);
			Zend_Mail::setDefaultTransport($tr);
	}
	
	public function getTemplate( $template , $args ){
         
        // MONTA VIEW
		$this->smarty = Zend_Registry::get("view");

         // ENVIA VARIAVEIS PARA VIEW
         foreach($args as $k => $v){
             $this->smarty->assign($k, $v);
         }
         
         return $this->smarty->fetch("email_templates/".$template.".html");
	}
}
?>